//
//  DHNewsDetailCoverCell.m
//  Dresshere
//
//  Created by ZhangPeng on 2018/5/28.
//  Copyright © 2018年 张朋. All rights reserved.
//

#import "DHNewsDetailCoverCell.h"

@implementation DHNewsDetailCoverCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.coverImageView.layer.cornerRadius = self.coverImageView.height / 2;
}

- (void)updateCell:(NSDictionary *)dic{
    [self.coverImageView dh_setImageURLString:[dic objectForKey:@"cover"]];
    self.titleLabel.text = [dic objectForKey:@"title"];
    self.nameLabel.text = [[dic objectForKey:@"owner"] objectForKey:@"nickname"];
    NSDate *date = [NSDate dateWithServerISOString:[dic objectForKey:@"createdAt"] format:@"yyyy-MM-dd'T'HH:mm:ss.SSSZ"];
    self.timeLabel.text = [NSDate stringFromDate:date withFormat:@"yyyy/MM/dd HH:mm"];
    self.commentLabel.text = [NSString stringWithFormat:@"%@",[dic objectForKey:@"comments_count"]];
    self.likeLabel.text = [NSString stringWithFormat:@"%@",[dic objectForKey:@"collected_count"]];
    [self.headerImgView dh_setImageURLString:[[dic objectForKey:@"owner"] objectForKey:@"photo"]];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
